/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Shared Source License
* for DSL Editor PowerToy. A copy of the license can be found in the License.htm file
* at the root of this distribution. If you can not locate the Shared Source License
* for DSL Editor PowerToy, please obtain a copy from: http://www.codeplex.com/dsltreegrideditor/Project/License.aspx.
* By using this source code in any fashion, you are agreeing to be bound by
* the terms of the Shared Source License for DSL Editor PowerToy.
*
* You must not remove this notice, or any other, from this software.
*
* **********************************************************************************/
using System;
using System.Text;
using System.Runtime.Serialization;
using System.Xml;

using EnvDTE80;
using EnvDTE;

using Microsoft.Practices.RecipeFramework.Extensions.References.VisualStudio;

using DslEditorPowerToy.Recipes.References;

namespace DslEditorPowerToy.Recipes.Configuration.References
{
    /// <summary>
    /// Unbound recipe for Adding PowerToy to DSL solutions
    /// </summary>
    [Serializable]
    [CLSCompliant(false)]
    public class AddToDSLSolutionReference : SolutionReference
    {
        #region Constructors
        public AddToDSLSolutionReference(string recipe)
            : base(recipe)
        {
        }
        #endregion

        #region ISerializable Members

        /// <summary>
        /// Required constructor for deserialization.
        /// </summary>
        protected AddToDSLSolutionReference(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        #endregion ISerializable Members

        #region Public Properties
        /// <summary>
        /// Returns the friendly name for the reference
        /// </summary>
        public override string AppliesTo
        {
            get
            {
                return DslEditorPowerToy.Recipes.Configuration.Properties.Resources.DSLSolutionReference_AppliesTo;
            }
        }
        #endregion

        #region Public Methods
        /// <summary>
        /// Determines if the specified target is valid for this reference
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public override bool IsEnabledFor(object target)
        {
            return (target is EnvDTE.Solution);
        }
        #endregion
    }
}
